(function($){
$(function(){
	$(".fan").on("touchend",function(){
		window.open("ziliao.html","_self");
	});
	
	var goodsId = localStorage.getItem("goodsId");
	var names = localStorage.getItem("name")
		$.ajax({
		   type: "get",
		   url: "http://datainfo.duapp.com/shopdata/getGoods.php",
		   data: "goodsID="+goodsId+"&pageCode=0",
		   dataType:"jsonp",
		   success:function(data){
		    var Imhtml = "";
		    var miaoshu = ""
		    var arr=eval(data[0].imgsUrl);
		    console.log(arr[0]);
		    Imhtml='<img src="'+arr[0]+'"/>'
		    	
		    $(".bannerx").html(Imhtml);

		     miaoshu = "<p>品牌 : "+data[0].goodsName+"</p>";
		     miaoshu+= "<p>种类 : "+data[0].className+"</p>";
		     var arr1 = data[0].detail.split("。");
		     $.each(arr1, function(index){
		     	miaoshu += "<p>"+arr1[index]+"</p>"
		     });
		     
		     $(".miaoshu").html(miaoshu);
		    
	
		   }
		});
	
	var num=0;
		$.ajax({
			  type: "get",
			   url: "http://datainfo.duapp.com/shopdata/getCar.php",
			   data: {userID:names},
			   dataType:"jsonp",
			   success:function(data){
			   	$.each(data, function(index){
			     	num+=parseInt(data[index].number);
			     	if(goodsId==data[index].goodsID){
			     		liang = data[index].number;
			     	}
			   	})
			   	console.log(liang,num);
			   	if(num){
					$(".car_num").css("display","block").html(num);
				}else{
					$(".car_num").css("display","none")
				}
			   }
			});
	
})
})(jQuery)